package com.xuecheng.content.convert;

import com.xuecheng.api.content.model.dto.TeachplanMediaDTO;
import com.xuecheng.content.entity.TeachplanMedia;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

/**
 * <p> </p>
 *
 * @Description:
 */
@Mapper
public interface TeachplanMediaConvert {
    //根据MapStruct的api来创建出接口的实现类
    TeachplanMediaConvert INSTANCE = Mappers.getMapper(TeachplanMediaConvert.class);

    //编写转换方法
    @Mapping(source = "id", target = "teachplanMediaId")
    TeachplanMediaDTO entity2dto(TeachplanMedia teachplanMedia);

    @Mapping(source = "teachplanMediaId", target = "id")
    TeachplanMedia dto2entity(TeachplanMediaDTO teachplanDTO);
}
